package interfaces;


import java.io.File;

import com.example.bottest.R;
import com.example.bottest.R.id;
import com.example.bottest.R.layout;
import com.example.bottest.R.menu;

import fonctions.FileDialog;
import fonctions.FileDialog.DirectorySelectedListener;
import fonctions.FileDialog.FileSelectedListener;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends Activity implements View.OnTouchListener, View.OnClickListener {
	private TextView texte = null;
	FileDialog fileDialog;
	private Button modeEdit = null;
	private Button modePlongee = null;
	Intent intent;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		modeEdit = (Button) findViewById(R.id.preparation); //settings for our "find devices" button 
		modeEdit.setOnTouchListener(this);
		modeEdit.setOnClickListener(this);
		
		modePlongee = (Button) findViewById(R.id.plongee); //settings for our "find devices" button 
		modePlongee.setOnTouchListener(this);
		modePlongee.setOnClickListener(this);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
	
	@Override
	public void onClick(View arg0) { //called when the user pressed a button
		switch(arg0.getId()) {
		case R.id.preparation:
			//setProgressBarIndeterminateVisibility(true);   //When the user clicks on the "scann" button we start a discovery
			intent = new Intent(MainActivity.this, Preparation.class);
			startActivity(intent);
			break;
		case R.id.plongee:
			intent = new Intent(MainActivity.this, Plongee.class);
			startActivity(intent);
			break;
		}
	}

	@Override
	public boolean onTouch(View arg0, MotionEvent arg1) {
		return false;
	}
	
	
	
}
